<extend name="./Apps/Home/View/default/shops/layout.html" />
<block name="content">
<script>
$(document).ready(function(){
    <notempty name='shopCatId1'>
    getShopCatListForAppraises('{$shopCatId1}','{$shopCatId2}');
    </notempty>
});
</script>
<div class="wst-body"> 
<div class='wst-page-header'>卖家中心 > 评价管理</div>
<div class='wst-page-content'>
   <div class='wst-tbar-query'>
    店铺分类：<select id='shopCatId1' autocomplete="off" onchange='javascript:getShopCatListForAppraises(this.value,"{$object['shopCatId2']}")'>
	         <option value='0'>请选择</option>
	         <volist name="shopCatsList" id="vo">
	         <option value='{$vo['catId']}' <if condition="$shopCatId1 == $vo['catId'] ">selected</if>>{$vo['catName']}</option>
	         </volist>
	     </select>
	     <select id='shopCatId2' autocomplete="off">
	         <option value='0'>请选择</option>
	     </select>
        商品：<input type='text' id='goodsName' value='{$goodsName}'/>
      <button style="border:1px solid #ffffff;height:30px;width:60px;background-color:#e23e3d;color:#ffffff;cursor: pointer;" onclick='javascript:queryAppraises()'>查询</button>
   </div>
   <table class='wst-list' style="margin:0 auto;">
           <thead>
             <tr>
               <th width='40'>序号</th>
               <th width='200'>商品</th>
               <th>商品评分</th>
               <th>时效评分</th>
               <th>服务评分</th>
             </tr>
           </thead>
           <tbody>
           	<?php $c=1;?>
            <volist name="Page['root']" id="vo" key='k'>
             <tr>
               <td rowspan='2'>{$k}</td>
               <td rowspan='2'>
               <div style='width:300px;'>
	               <div style='width:55px;float:left'>
	               <a target='_blank' href="{:U('Home/Goods/getGoodsDetails/',array('goodsId'=>$vo['goodsId']))}">
						<img src="__ROOT__/{$vo['goodsThums']}" height="50" width="50"/>
				   </a>
				   </div>
				   <div style='width:245px;float:left'>
				 	<a target='_blank' href="{:U('Home/Goods/getGoodsDetails/',array('goodsId'=>$vo['goodsId']))}">
				   	{$vo['goodsName']}<if condition="$vo['goodsAttrName'] neq ''">【{$vo['goodsAttrName']}】</if>
				   	</a>
				   </div>
               </div>
               </td>
               <td>
               	<div>商品评分：
               	<for start="0" end="$vo['goodsScore']">
					<img src="__ROOT__/Apps/Home/View/default/images/icon_score_yes.png"/>
				</for>&nbsp;{$vo['goodsScore']} 分
				</div>
				</td>
				<td>
				<div>时效评分：
               	<for start="0" end="$vo['timeScore']">
					<img src="__ROOT__/Apps/Home/View/default/images/icon_score_yes.png"/>
				</for>&nbsp;{$vo['goodsScore']} 分
				</div>
                </td>
                <td>
              	<div>服务评分：
               	<for start="0" end="$vo['serviceScore']">
					<img src="__ROOT__/Apps/Home/View/default/images/icon_score_yes.png"/>
				</for>&nbsp;{$vo['goodsScore']} 分
				</div>
               </td>
             </tr>

             <tr>
               <td colspan='3'>评价[{$vo['loginName']}]：{$vo['content']}
               		 
               		<div id="layer-photos-appraise{$c}"  style="margin-bottom:10px"> 
               		  <?php foreach($vo['appraisesAnnex'] as $q=>$v):?>
					  <img  layer-src="__ROOT__/<?=$v?>" width="50" src="__ROOT__/<?=str_replace('.','_thumb.',$v)?>" alt="{$vo['content']}">
					  <?php endforeach;?>
					</div>
               </td>
             </tr>
             <?php ++$c;?>
             </volist>
             
           </tbody>
           <tfoot>
             <tr>
                <td colspan='8' align='center'>
                <div class="wst-page" style="float:right;padding-bottom:10px;">
						<div id="wst-page-items"></div>
				</div>
                <script>
			    <if condition="$Page['totalPage'] gt 1">
			    $(document).ready(function(){
					laypage({
					    cont: 'wst-page-items',
					    pages: {$Page['totalPage']}, //总页数
					    skip: true, //是否开启跳页
					    skin: '#e23e3d',
					    groups: 3, //连续显示分页数
					    curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
					        var page = location.search.match(/p=(\d+)/);
					        return page ? page[1] : 1;
					    }(), 
					    jump: function(e, first){ //触发分页后的回调
					        if(!first){ //一定要加此判断，否则初始时会无限刷新
					        	var nuewurl = WST.splitURL("p");
					        	var ulist = nuewurl.split("?");
					        	if(ulist.length>1){
					        		location.href = nuewurl+'&p='+e.curr;
					        	}else{
					        		location.href = '?p='+e.curr;
					        	}
					            
					        }
					    }
					});
			    });
				</if>
				<?php for($i=1;$i<$c;++$i) {?>
             			layer.photos({
						    photos: '#layer-photos-appraise'+<?=$i?>
						  });
             	<?php }?>
				

				</script>
                </td>
             </tr>
             </tfoot>
        </table>
</div>
</div>
</block> 